package net.fdukedom.epicurus.service.interaction;

import java.io.IOException;
import java.io.StringReader;

import org.jdom.JDOMException;
import org.jdom.input.SAXBuilder;

public class RequestReader extends Request {
	/**
	 * XML request string
	 */
	private String xmlRequest;
	
    /**
     * @param request
     */
	public RequestReader(String request) {
		xmlRequest = request;
		createDocument();
	}
	
	@Override
	protected void createDocument() {
		try {
			SAXBuilder builder = new SAXBuilder();
			
			doc = builder.build(new StringReader(xmlRequest));
		} catch (JDOMException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		} catch (IOException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}	
	}
}
